﻿<Window x:Class="CloudClipboardSync.Windows.SettingsWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Settings :: Cloud Clipboard Sync" Height="450" Width="603" DataContext="{Binding ., Source={StaticResource programData}}">
    <DockPanel Margin="10">
        <Button DockPanel.Dock="Bottom" Content="OK" Width="100" Margin="0 5 0 0" Padding="4 2" Command="{Binding SettingWindowOkCommand}"/>
        <StackPanel DockPanel.Dock="Top">
            <TextBlock Text="Settings" FontWeight="Bold" FontSize="16"/>
            <StackPanel Margin="10 8">
                <CheckBox Content="Start automatically at startup" IsChecked="{Binding AutoStart}"/>
            </StackPanel>
            <TextBlock Text="Security features" FontWeight="Bold" FontSize="16"/>
            <StackPanel Margin="10 8">
                <CheckBox Content="Encrypt clipboard contents" IsChecked="{Binding CurrentProfile.UseEncryption}"/>
                <CheckBox Content="Do not login automatically" Margin="0 5 0 0" IsChecked="{Binding CurrentProfile.DoNotUseAutoLogin}" />
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Program access control" FontWeight="Bold" FontSize="16" />
                <CheckBox Content="Enable" FontWeight="Bold" VerticalAlignment="Bottom" Margin="14 0 0 1" IsChecked="{Binding CurrentProfile.ProgramAclEnabled}" />
            </StackPanel>
        </StackPanel>
        <DockPanel Margin="10 8" IsEnabled="{Binding CurrentProfile.ProgramAclEnabled}">
            <StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="0 0 0 0">
                <RadioButton Content="Allow the following programs" IsChecked="{Binding CurrentProfile.UseWhiteList}" />
                <RadioButton Content="Block the following programs" Margin="14 0 0 0" IsChecked="{Binding CurrentProfile.UseWhiteList, Converter={StaticResource NegateConverter}}" />
            </StackPanel>
            <DataGrid Margin="0 10 0 0" ItemsSource="{Binding CurrentProfile.RegexPatterns}" AutoGenerateColumns="False">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding RegexPattern}" Header="Regular expression" Width="*" />
                    <DataGridCheckBoxColumn Binding="{Binding IsEnabled}" Header="Enabled" Width="SizeToHeader" />
                </DataGrid.Columns>
            </DataGrid>
        </DockPanel>
    </DockPanel>
</Window>
